package com.cchr.acms.tags;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;

public class DisabledSelectTag extends SimpleTagSupport {

	String label;
	
	@Override
	public void doTag() throws JspException, IOException {
		label = "1".equals(label) ? "yes" : "no";
		PageContext pc = (PageContext)getJspContext(); 
		JspWriter out = pc.getOut(); 
		StringBuilder sb = new StringBuilder();
		sb.append("<select disabled><option>")
		.append(label).append("</option></select>");
		out.println(sb.toString());
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}
}
